<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        const man = 'jieki'
        const woman = 'mali'
        // 实现 console.log(man.name)   //'mali'
       // console.log(woman.name) // jieki

    // answer
        Object.defineProperty(Object.prototype,'name',{
            get:function(val) {
                if(this.valueOf()=='jieki')  {
                   
                    return 'mali'
                } else if(this.valueOf()=='mali') {
                    return 'jieki'
                }
            }
       
        })
        console.log(man.name)   //'mali'
        console.log(woman.name) // jieki
      
 
  
</script>
</body>
</html>